Skip to content

Remove v3.9 and add v3.14#3115

Merged
ahopkins merged 5 commits into
mainfrom
python-version-changes
Dec 31, 2025
Merged

Remove v3.9 and add v3.14#3115
ahopkins merged 5 commits into
mainfrom
python-version-changes

Conversation

@ahopkins

@ahopkins ahopkins commented Dec 31, 2025

Copy link
Copy Markdown
Member

I've been waiting for this one for a looooooong time.

Copilot AI review requested due to automatic review settings December 31, 2025 09:14
@ahopkins ahopkins requested review from a team as code owners December 31, 2025 09:14

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates Sanic's Python version support by removing Python 3.9 and adding Python 3.14 support. It includes modernizing type annotations to use PEP 604 syntax (| instead of Union/Optional), updating version checks for Python 3.14 compatibility, and updating configuration across build and test systems.

Key changes:

  • Minimum Python version increased from 3.9 to 3.10
  • Type annotations modernized to use PEP 604 union syntax (| instead of Union/Optional)
  • Python 3.14 compatibility changes for asyncio API changes

Reviewed changes

Copilot reviewed 78 out of 78 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
tox.ini Updated test environment list to remove py39 and add py314
setup.py Updated python_requires and classifiers to reflect new version range
pyproject.toml Updated ruff target-version to py310
.github/workflows/tests.yml Updated CI matrix to test Python 3.10-3.14 instead of 3.9-3.13
sanic/worker/*.py Modernized type annotations and added from __future__ import annotations
sanic/server/protocols/http_protocol.py Added version check for Python 3.14's Task.cancel() API change
sanic/server/websockets/impl.py Changed asyncio.get_event_loop() to get_running_loop()
sanic/server/async_server.py Removed deprecated loop parameter from ensure_future()
sanic/app.py Added version check for Task.cancel() and listener deprecation warning
sanic/*.py (many files) Modernized type annotations throughout codebase
README.rst, guide files Updated documentation to reflect Python 3.10+ requirement

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread sanic/app.py
Comment thread sanic/server/websockets/impl.py Outdated
Comment thread sanic/server/protocols/http_protocol.py
Comment thread sanic/request/types.py
@codecov

codecov Bot commented Dec 31, 2025

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 96.74797% with 8 lines in your changes missing coverage. Please review.
✅ Project coverage is 87.893%. Comparing base (3ae8f8a) to head (ddfd420).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
sanic/app.py 83.333% 1 Missing and 2 partials ⚠️
sanic/models/protocol_types.py 66.666% 0 Missing and 2 partials ⚠️
sanic/server/protocols/http_protocol.py 75.000% 1 Missing and 1 partial ⚠️
sanic/server/websockets/impl.py 93.750% 1 Missing ⚠️
Additional details and impacted files
@@              Coverage Diff              @@
##              main     #3115       +/-   ##
=============================================
+ Coverage   87.877%   87.893%   +0.015%     
=============================================
  Files          105       105               
  Lines         8076      8078        +2     
  Branches      1280      1281        +1     
=============================================
+ Hits          7097      7100        +3     
+ Misses         674       671        -3     
- Partials       305       307        +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@ahopkins ahopkins merged commit 002c8c2 into main Dec 31, 2025
26 checks passed
@ahopkins ahopkins deleted the python-version-changes branch December 31, 2025 11:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants